package com.hzw.saas.api.storage.bo;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzw.saas.api.storage.enums.ResourceStatusEnum;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 资源信息
 *
 * @author zzl
 * @since 12/24/2020
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("系统资源文件")
public class SysResourceBO implements Serializable {

    private static final long serialVersionUID = -8828838318925676884L;

    /**
     * ID
     */
    @ApiModelProperty(value = "资源ID", position = 1, required = true)
    private String fileId;

    /**
     * 资源名称
     */
    @ApiModelProperty(value = "资源名称", position = 2, required = true)
    private String name;

    /**
     * 资源后缀
     * 备用
     */
    @ApiModelProperty(value = "资源后缀", position = 3, required = false, hidden = true)
    private String suffix;

    /**
     * 资源大小, 字节
     */
    @ApiModelProperty(value = "资源大小, 字节", position = 4, required = true)
    private Long length;

    /**
     * 资源摘要
     */
    @ApiModelProperty(value = "资源摘要", position = 5)
    private String digest;

    /**
     * 资源状态
     *
     * @see ResourceStatusEnum
     */
    @ApiModelProperty(value = "资源状态, 200-正常，400-删除", position = 6, required = true)
    private Integer status;

    /**
     * 存储类型
     */
    @ApiModelProperty(value = "存储类型", position = 7)
    private String serviceType;

    /**
     * 存储名称
     */
    @ApiModelProperty(value = "存储名称", position = 8)
    private String serviceProvider;

    /**
     * 存储虚拟目录
     */
    @ApiModelProperty(value = "存储虚拟目录", position = 9)
    private String catalog;

    /**
     * 资源路径
     */
    @ApiModelProperty(value = "资源路径", position = 10)
    private String url;

    /**
     * 资源存储Key
     */
    @ApiModelProperty(value = "资源存储Key", position = 11)
    private String resourceKey;

    /**
     * 创建者ID
     */
    @ApiModelProperty(value = "创建者ID", position = 12)
    private String creatorId;

    /**
     * 创建者用户名
     */
    @ApiModelProperty(value = "创建者用户名", position = 13)
    private String creatorName;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss", position = 14)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

}
